Optimal. Leaf size=231 \[ -\frac {2 n \cot (e+f x) (d \csc (e+f x))^{2+n}}{3 a^2 d^2 f (1+\csc (e+f x))}+\frac {\cot (e+f x) (d \csc (e+f x))^{2+n}}{3 d^2 f (a+a \csc (e+f x))^2}+\frac {2 n \cos (e+f x) (d \csc (e+f x))^{2+n} \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-2-n);-\frac {n}{2};\sin ^2(e+f x)\right )}{3 a^2 d^2 f \sqrt {\cos ^2(e+f x)}}-\frac {(1+2 n) \cos (e+f x) (d \csc (e+f x))^{1+n} \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-1-n);\frac {1-n}{2};\sin ^2(e+f x)\right )}{3 a^2 d f \sqrt {\cos ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.30, antiderivative size = 231, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3317, 3902,
4105, 3872, 3857, 2722} \begin {gather*} \frac {2 n \cos (e+f x) (d \csc (e+f x))^{n+2} \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-n-2);-\frac {n}{2};\sin ^2(e+f x)\right )}{3 a^2 d^2 f \sqrt {\cos ^2(e+f x)}}-\frac {2 n \cot (e+f x) (d \csc (e+f x))^{n+2}}{3 a^2 d^2 f (\csc (e+f x)+1)}-\frac {(2 n+1) \cos (e+f x) (d \csc (e+f x))^{n+1} \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-n-1);\frac {1-n}{2};\sin ^2(e+f x)\right )}{3 a^2 d f \sqrt {\cos ^2(e+f x)}}+\frac {\cot (e+f x) (d \csc (e+f x))^{n+2}}{3 d^2 f (a \csc (e+f x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 3317
Rule 3857
Rule 3872
Rule 3902
Rule 4105
Rubi steps
\begin {align*} \int \frac {(d \csc (e+f x))^n}{(a+a \sin (e+f x))^2} \, dx &=\frac {\int \frac {(d \csc (e+f x))^{2+n}}{(a+a \csc (e+f x))^2} \, dx}{d^2}\\ &=\frac {\cot (e+f x) (d \csc (e+f x))^{2+n}}{3 d^2 f (a+a \csc (e+f x))^2}-\frac {\int \frac {(d \csc (e+f x))^{2+n} (a (-1+n)-a (1+n) \csc (e+f x))}{a+a \csc (e+f x)} \, dx}{3 a^2 d^2}\\ &=-\frac {2 n \cot (e+f x) (d \csc (e+f x))^{2+n}}{3 a^2 d^2 f (1+\csc (e+f x))}+\frac {\cot (e+f x) (d \csc (e+f x))^{2+n}}{3 d^2 f (a+a \csc (e+f x))^2}-\frac {\int (d \csc (e+f x))^{2+n} \left (-a^2 (1+n) (1+2 n)+2 a^2 n (2+n) \csc (e+f x)\right ) \, dx}{3 a^4 d^2}\\ &=-\frac {2 n \cot (e+f x) (d \csc (e+f x))^{2+n}}{3 a^2 d^2 f (1+\csc (e+f x))}+\frac {\cot (e+f x) (d \csc (e+f x))^{2+n}}{3 d^2 f (a+a \csc (e+f x))^2}-\frac {(2 n (2+n)) \int (d \csc (e+f x))^{3+n} \, dx}{3 a^2 d^3}+\frac {((1+n) (1+2 n)) \int (d \csc (e+f x))^{2+n} \, dx}{3 a^2 d^2}\\ &=-\frac {2 n \cot (e+f x) (d \csc (e+f x))^{2+n}}{3 a^2 d^2 f (1+\csc (e+f x))}+\frac {\cot (e+f x) (d \csc (e+f x))^{2+n}}{3 d^2 f (a+a \csc (e+f x))^2}-\frac {\left (2 n (2+n) (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{-3-n} \, dx}{3 a^2 d^3}+\frac {\left ((1+n) (1+2 n) (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{-2-n} \, dx}{3 a^2 d^2}\\ &=-\frac {2 n \cot (e+f x) (d \csc (e+f x))^{2+n}}{3 a^2 d^2 f (1+\csc (e+f x))}+\frac {\cot (e+f x) (d \csc (e+f x))^{2+n}}{3 d^2 f (a+a \csc (e+f x))^2}+\frac {2 n \cot (e+f x) \csc (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-2-n);-\frac {n}{2};\sin ^2(e+f x)\right )}{3 a^2 f \sqrt {\cos ^2(e+f x)}}-\frac {(1+2 n) \cos (e+f x) (d \csc (e+f x))^{1+n} \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-1-n);\frac {1-n}{2};\sin ^2(e+f x)\right )}{3 a^2 d f \sqrt {\cos ^2(e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F]
time = 1.92, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(d \csc (e+f x))^n}{(a+a \sin (e+f x))^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.55, size = 0, normalized size = 0.00 \[\int \frac {\left (d \csc \left (f x +e \right )\right )^{n}}{\left (a +a \sin \left (f x +e \right )\right )^{2}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\left (d \csc {\left (e + f x \right )}\right )^{n}}{\sin ^{2}{\left (e + f x \right )} + 2 \sin {\left (e + f x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (\frac {d}{\sin \left (e+f\,x\right )}\right )}^n}{{\left (a+a\,\sin \left (e+f\,x\right )\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________